export default {
  positionWelfare(data) {
    let strData = [];
    data.forEach((index) => {
      JSON.parse(localStorage.getItem("positionWelfare")).forEach((res) => {
        if (res.id == index) {
          strData.push(res.dictValue);
        }
      });
    });
    return strData.join();
  },
  positionType(data) {
    let name
    JSON.parse(localStorage.getItem("positionType")).forEach((res) => {
      if (data == res.id) {
         name = res.dictValue
        return 
      }
    });
    return name
  },
  sectorIdData(data) {
    let name
    JSON.parse(localStorage.getItem("profession")).forEach((res) => {
      if (data == res.id) {
         name = res.dictValue
        return 
      }
    });
    return name
  },
  scaleData(data) {
    let name
    JSON.parse(localStorage.getItem("staffSize")).forEach((res) => {
      if (data == res.id) {
         name = res.dictValue
        return 
      }
    });
    return name
  },
  position91011(key,start,end){ 
    console.log(key,start,end);
    if(key == '工作经验'){ //工作经验
      if (start != '0' && end == '99') {
        return `${start}年以上`
      } else if (start == '0' && end == '99') {
        return `不限`
      } else {
        return `${start}-${end}年`
      }
    }
    if(key == '薪酬范围'){ //薪酬范围
      if (end == '99999') {
        return `${start}以上`
      } else if (end == '88888') {
        return  `不低于${start}`
      } else {
        return `${start}-${end}`
      }
    }
    if(key == '年龄要求'){ //年龄要求
      if (end == '99') {
        return `${start}以上`
      } else if (start == '0') {
        return `不低于${end}`
      } else {
        return `${start}-${end}`
      }
    }
  },
};
